<html>
<head><meta charset="utf-8"><title>chalk integration · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html">chalk integration</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="160041045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160041045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160041045">(Mar 05 2019 at 21:18)</a>:</h4>
<p>This is kind of a minor point in the grand scheme of things, but chalk is currently nightly-only, while rust-analyzer builds on stable. Some of that is probably easy to fix and I'd be happy to do it (it would be an opportunity to get a bit more familiar with the chalk codebase), but chalk also seems to use specialization, which I assume won't be so easy to get around? <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="160041412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160041412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160041412">(Mar 05 2019 at 21:23)</a>:</h4>
<p><span class="user-mention" data-user-id="129457">@Florian Diebold</span> mmh I don't think chalk is actually doing something useful with specialization</p>



<a name="160041460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160041460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160041460">(Mar 05 2019 at 21:23)</a>:</h4>
<p>(I didn't even know we had the feature flag activated)</p>



<a name="160042318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160042318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160042318">(Mar 05 2019 at 21:35)</a>:</h4>
<p>Ah yeah, apparently it's only used for a Debug implementation</p>



<a name="160046769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160046769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160046769">(Mar 05 2019 at 22:27)</a>:</h4>
<p>Moving to stable seems fine to me</p>



<a name="160128711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160128711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160128711">(Mar 06 2019 at 19:54)</a>:</h4>
<p>I'll make a PR soon then, hopefully ;)</p>
<p>Meanwhile... I currently only have the vaguest idea how integrating chalk would actually look -- i.e. what data would rust-analyzer have to provide, and what forms of queries would it make. I've read the material in the rustc guide, but if I understand you correctly, e.g. the lowering logic would come from chalk. Is the <code>rust_ir</code> module in chalk basically the input for the lowering? And on the query side, would canonicalization happen in chalk?</p>
<p>This might be material for another meeting, but maybe you can give me some pointers already ;)</p>
<p>(btw, I wonder if we could integrate the chalk repl into RA, once the lowering works, so one could make trait queries about the whole program...)</p>



<a name="160129627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160129627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160129627">(Mar 06 2019 at 20:04)</a>:</h4>
<p>Integrating with the chalk repl would be really cool, especially if it could answer queries about the current context</p>



<a name="160381843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160381843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160381843">(Mar 09 2019 at 20:11)</a>:</h4>
<p><span class="user-mention" data-user-id="129457">@Florian Diebold</span> Ideally, yes the lowering logic etc would come from chalk. I believe the best thing would be to have the <code>rust_ir</code> module somehow shared between chalk and RLS 2.0 (as an independent crate), so that RLS 2.0 just has to feed chalk with all the Rust constructs in the crate being analyzed</p>



<a name="160381874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160381874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160381874">(Mar 09 2019 at 20:12)</a>:</h4>
<p>integration with the chalk repl is a good idea, and would be straightforward if we managed to share that <code>rust_ir</code> thing</p>



<a name="160381901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160381901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160381901">(Mar 09 2019 at 20:12)</a>:</h4>
<p>I think just using a <code>git</code> dependency in Cargo.toml should work for sharing?</p>



<a name="160381913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160381913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160381913">(Mar 09 2019 at 20:13)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> yes it would work, but I was thinking more about refactoring and enhancing that module so that it is indeed easily shareable and covers most needs</p>



<a name="160514894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160514894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160514894">(Mar 11 2019 at 20:26)</a>:</h4>
<p>So in the <span class="user-group-mention" data-user-group-id="692">@WG-traits</span> meeting today we discussed the idea of having a session to kind of brainstorm this out</p>



<a name="160514935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160514935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160514935">(Mar 11 2019 at 20:27)</a>:</h4>
<p>we could do this tomorrow at at 15:00 UTC-04:00 (Boston time), if that works for everyone</p>



<a name="160515007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160515007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160515007">(Mar 11 2019 at 20:28)</a>:</h4>
<p>I'd probably block out two hours just to give us more time to think things over ...</p>



<a name="160515047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160515047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160515047">(Mar 11 2019 at 20:28)</a>:</h4>
<p>well, maybe I'll schedule that onto my calendar regardless -- not sure if it needs to be a compile-team calendar event, but I guess there's no harm</p>



<a name="160515207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160515207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160515207">(Mar 11 2019 at 20:30)</a>:</h4>
<p>(I added it to my personal calendar, anyway)</p>



<a name="160515527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160515527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160515527">(Mar 11 2019 at 20:35)</a>:</h4>
<p>15:00 tomorrow Boston time works for me</p>



<a name="160522936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160522936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160522936">(Mar 11 2019 at 22:13)</a>:</h4>
<p>Works for me!</p>



<a name="160549155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160549155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160549155">(Mar 12 2019 at 07:32)</a>:</h4>
<p>works for me as well. Let's make a calendar event? It's easy to forget or misconvert the timezones :)</p>



<a name="160597657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160597657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160597657">(Mar 12 2019 at 18:39)</a>:</h4>
<p>I don't see it on the calendar, but that should be in 20 minutes</p>



<a name="160599827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160599827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160599827">(Mar 12 2019 at 19:04)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ping, is there a meeting?</p>



<a name="160599890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160599890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160599890">(Mar 12 2019 at 19:05)</a>:</h4>
<p>Yeah, give me a few. Sorry, I didn't make it a "global calendar event"</p>



<a name="160599907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160599907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160599907">(Mar 12 2019 at 19:05)</a>:</h4>
<p>I need ~5 minut :)</p>



<a name="160600019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600019">(Mar 12 2019 at 19:06)</a>:</h4>
<p>pinging <span class="user-mention" data-user-id="129457">@Florian Diebold</span> &amp; <span class="user-mention" data-user-id="131694">@scalexm</span> in advance</p>



<a name="160600722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600722">(Mar 12 2019 at 19:15)</a>:</h4>
<p>OK, I'm back</p>



<a name="160600733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600733">(Mar 12 2019 at 19:15)</a>:</h4>
<p>I didn't really have a <em>super concrete</em> plan here</p>



<a name="160600748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600748">(Mar 12 2019 at 19:15)</a>:</h4>
<p>which is partly why I didn't schedule a firm meeting</p>



<a name="160600764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600764">(Mar 12 2019 at 19:15)</a>:</h4>
<p>sorry, today has of course been messier than anticipated</p>



<a name="160600772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600772">(Mar 12 2019 at 19:16)</a>:</h4>
<p>so my mind is a bit scattered</p>



<a name="160600818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600818">(Mar 12 2019 at 19:16)</a>:</h4>
<p>I guess I can imagine a few ways forward:</p>



<a name="160600831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600831">(Mar 12 2019 at 19:16)</a>:</h4>
<ul>
<li>do a bit of "exploratory hacking" while sharing screen, e.g., over Zoom, maybe record for later :)</li>
</ul>



<a name="160600849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600849">(Mar 12 2019 at 19:16)</a>:</h4>
<ul>
<li>discuss over Zulip a bit instead, perhaps taking notes in a dropbox paper</li>
</ul>



<a name="160600860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600860">(Mar 12 2019 at 19:16)</a>:</h4>
<p>I'm sort of leaning towards the latter -- i.e., maybe we could sketch out first what we think a Chalk integration would look like</p>



<a name="160600877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600877">(Mar 12 2019 at 19:17)</a>:</h4>
<p>I'm fine with option 2</p>



<a name="160600882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600882">(Mar 12 2019 at 19:17)</a>:</h4>
<p>then we can kind of try to map that to RLS?</p>



<a name="160600908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160600908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160600908">(Mar 12 2019 at 19:17)</a>:</h4>
<p>Here is a <a href="https://paper.dropbox.com/doc/Chalk-RLS-integration--AZOAaGqTORQAptU93qcCqIuOAg-QCJelXDeaq7GV6jVQln4j" target="_blank" title="https://paper.dropbox.com/doc/Chalk-RLS-integration--AZOAaGqTORQAptU93qcCqIuOAg-QCJelXDeaq7GV6jVQln4j">dropbox paper document</a></p>



<a name="160601045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601045">(Mar 12 2019 at 19:19)</a>:</h4>
<p>whops</p>



<a name="160601079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601079">(Mar 12 2019 at 19:19)</a>:</h4>
<p>sorry, that wasn't meant to be posted here :)</p>



<a name="160601163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601163">(Mar 12 2019 at 19:20)</a>:</h4>
<p>So this integration, is it changing Chalk to be usable for RLS, changing the RLS so it can use Chalk, or both?</p>



<a name="160601199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601199">(Mar 12 2019 at 19:21)</a>:</h4>
<p>I expect it'll be some of both</p>



<a name="160601214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601214">(Mar 12 2019 at 19:21)</a>:</h4>
<p>I was just thinking about where to start..</p>



<a name="160601245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601245">(Mar 12 2019 at 19:21)</a>:</h4>
<p>...I guess we know that (a) we want to share the lowering code</p>



<a name="160601276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601276">(Mar 12 2019 at 19:22)</a>:</h4>
<p>so maybe we can elaborate a bit what it needs</p>



<a name="160601311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601311">(Mar 12 2019 at 19:22)</a>:</h4>
<p>this is code which basically takes the set of traits + impls and produces a set of rules</p>



<a name="160601346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601346">(Mar 12 2019 at 19:22)</a>:</h4>
<p>Presumably, this needs to speak about types as well?</p>



<a name="160601560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601560">(Mar 12 2019 at 19:25)</a>:</h4>
<p>Yes</p>



<a name="160601652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601652">(Mar 12 2019 at 19:26)</a>:</h4>
<p>so one other thing is that</p>



<a name="160601659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601659">(Mar 12 2019 at 19:26)</a>:</h4>
<p>we have to be able to do the lowering "piecemeal"</p>



<a name="160601674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601674">(Mar 12 2019 at 19:26)</a>:</h4>
<p>i.e., we have to be able to lower the impls for one specific trait</p>



<a name="160601739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601739">(Mar 12 2019 at 19:27)</a>:</h4>
<p>so I guess that means we have something like this:</p>
<ul>
<li>some shared way to represent an impl:<br>
    - this means representing types, where clauses, etc -- we can find the complete list in chalk-ir</li>
</ul>



<a name="160601753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601753">(Mar 12 2019 at 19:27)</a>:</h4>
<p>I'm debating how chalk lowering should integrate here. One option is</p>



<a name="160601758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601758">(Mar 12 2019 at 19:28)</a>:</h4>
<p>it can export some salsa queries</p>



<a name="160601821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601821">(Mar 12 2019 at 19:28)</a>:</h4>
<p>but it needs a way to "call out" into the context</p>



<a name="160601832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601832">(Mar 12 2019 at 19:28)</a>:</h4>
<p>we were planning on porting chalk to use salsa more deeply internally anyway</p>



<a name="160601839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601839">(Mar 12 2019 at 19:28)</a>:</h4>
<p>this is an interesting design question :)</p>



<a name="160601872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601872">(Mar 12 2019 at 19:29)</a>:</h4>
<p>i.e., I could imagine that we have a chalk library that exports some salsa queries, one of which is for a "context object" that we can use to query the AST</p>



<a name="160601882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601882">(Mar 12 2019 at 19:29)</a>:</h4>
<p>then the RLS can implement this one</p>



<a name="160601886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601886">(Mar 12 2019 at 19:29)</a>:</h4>
<p>and so can some unit tester</p>



<a name="160601895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601895">(Mar 12 2019 at 19:29)</a>:</h4>
<p>(I wonder if we'll hit some obstacle trying do that)</p>



<a name="160601916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601916">(Mar 12 2019 at 19:29)</a>:</h4>
<p>context won't be a real query, right?</p>



<a name="160601923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601923">(Mar 12 2019 at 19:29)</a>:</h4>
<p>well it's more like a "constant"</p>



<a name="160601928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601928">(Mar 12 2019 at 19:29)</a>:</h4>
<p>Just an <code>DB: AsRef&lt;Context&gt;</code> or smth like that?</p>



<a name="160601932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601932">(Mar 12 2019 at 19:30)</a>:</h4>
<p>ah well I guess that's the trick we can use duh</p>



<a name="160601992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160601992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160601992">(Mar 12 2019 at 19:30)</a>:</h4>
<p>that is, we can just add a trait of our own</p>



<a name="160602069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602069">(Mar 12 2019 at 19:30)</a>:</h4>
<p>something like this</p>
<div class="codehilite"><pre><span></span><span class="k">trait</span><span class="w"> </span><span class="n">ChalkCallbacks</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">ast_of_an_impl</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Ast</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="cp">#[salsa::query_database]</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">ChalkDatabase</span>: <span class="nc">ChalkCallbacks</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="160602081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602081">(Mar 12 2019 at 19:30)</a>:</h4>
<p>then RLS 2.0 can just implement those callbacks in terms of whatever queries it wants</p>



<a name="160602098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602098">(Mar 12 2019 at 19:31)</a>:</h4>
<p>SGMT</p>



<a name="160602228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602228">(Mar 12 2019 at 19:32)</a>:</h4>
<p>OK, that's good</p>



<a name="160602243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602243">(Mar 12 2019 at 19:32)</a>:</h4>
<p>so let's look a bit more closely at what the IR looks like I guess?</p>



<a name="160602284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602284">(Mar 12 2019 at 19:33)</a>:</h4>
<p>yeah, that is interesting</p>



<a name="160602302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602302">(Mar 12 2019 at 19:33)</a>:</h4>
<p>that would probably be pretty similar to what's currently in chalk's <code>rust_ir</code>, I guess?</p>



<a name="160602328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602328">(Mar 12 2019 at 19:33)</a>:</h4>
<p>yep I was just opening up that github repository</p>



<a name="160602333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602333">(Mar 12 2019 at 19:33)</a>:</h4>
<p>you mean chalk_ir?</p>



<a name="160602394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602394">(Mar 12 2019 at 19:34)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> no, <a href="https://github.com/rust-lang-nursery/chalk/blob/master/src/rust_ir.rs" target="_blank" title="https://github.com/rust-lang-nursery/chalk/blob/master/src/rust_ir.rs">https://github.com/rust-lang-nursery/chalk/blob/master/src/rust_ir.rs</a></p>



<a name="160602421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602421">(Mar 12 2019 at 19:34)</a>:</h4>
<p>so actually chalk lowering <strong>currently</strong> works in 2 phases</p>



<a name="160602427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602427">(Mar 12 2019 at 19:34)</a>:</h4>
<p>first, we have this parser</p>



<a name="160602461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602461">(Mar 12 2019 at 19:34)</a>:</h4>
<p><a href="https://github.com/rust-lang-nursery/chalk/blob/master/chalk-parse/src/ast.rs" target="_blank" title="https://github.com/rust-lang-nursery/chalk/blob/master/chalk-parse/src/ast.rs">it produces an AST</a></p>



<a name="160602493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602493">(Mar 12 2019 at 19:35)</a>:</h4>
<p>we process this somewhat to produce something analogous to the HIR, that is (part of) what lives in chalk-ir</p>



<a name="160602508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602508">(Mar 12 2019 at 19:35)</a>:</h4>
<p>er, yes, maybe that's <a href="https://github.com/rust-lang-nursery/chalk/blob/master/src/rust_ir.rs" target="_blank" title="https://github.com/rust-lang-nursery/chalk/blob/master/src/rust_ir.rs">rust_ir</a>, sorry</p>



<a name="160602518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602518">(Mar 12 2019 at 19:35)</a>:</h4>
<p>anyway I think we <strong>definitely</strong> don't want this AST</p>



<a name="160602537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602537">(Mar 12 2019 at 19:35)</a>:</h4>
<p>yeah</p>



<a name="160602589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602589">(Mar 12 2019 at 19:36)</a>:</h4>
<p>we probably want to refactor rust-ir to be more a set of queries</p>



<a name="160602596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602596">(Mar 12 2019 at 19:36)</a>:</h4>
<p>than a big data structure</p>



<a name="160602602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602602">(Mar 12 2019 at 19:36)</a>:</h4>
<p>yes</p>



<a name="160602627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602627">(Mar 12 2019 at 19:36)</a>:</h4>
<p>the stuff in rust-ir actually seems to me like it would be mostly pretty straightforward to provide from rust-analyzer</p>



<a name="160602651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602651">(Mar 12 2019 at 19:37)</a>:</h4>
<p>(there's a few details I'm not so sure about)</p>



<a name="160602774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602774">(Mar 12 2019 at 19:38)</a>:</h4>
<blockquote>
<p>the stuff in rust-ir actually seems to me like it would be mostly pretty straightforward to provide from rust-analyzer</p>
</blockquote>
<p>yeah I think overall should not be so hard</p>



<a name="160602798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602798">(Mar 12 2019 at 19:39)</a>:</h4>
<p>question: which of these things exist already?</p>



<a name="160602811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602811">(Mar 12 2019 at 19:39)</a>:</h4>
<p>i.e., is there a concept of (say) a <code>TraitRef</code> and so on?</p>



<a name="160602818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602818">(Mar 12 2019 at 19:39)</a>:</h4>
<p>although I have one general question... chalk is pretty focused on the perspective of one crate, right? I'm not sure how much difference it will really make, but whether an impl is local or external depends on what's the 'current' crate</p>



<a name="160602821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602821">(Mar 12 2019 at 19:39)</a>:</h4>
<p>I guess in the parser probably</p>



<a name="160602833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602833">(Mar 12 2019 at 19:39)</a>:</h4>
<blockquote>
<p>although I have one general question... chalk is pretty focused on the perspective of one crate, right? I'm not sure how much difference it will really make, but whether an impl is local or external depends on what's the 'current' crate</p>
</blockquote>
<p>well, this is presently true, but I think we could change that</p>



<a name="160602845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602845">(Mar 12 2019 at 19:39)</a>:</h4>
<p>almost nothing cares about that but coherence</p>



<a name="160602853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602853">(Mar 12 2019 at 19:39)</a>:</h4>
<p>yeah, there's not much of a HIR for traits and bounds so far in RA</p>



<a name="160602910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602910">(Mar 12 2019 at 19:40)</a>:</h4>
<p>I imagine what we will want is to have a "crate id" associated with things</p>



<a name="160602923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602923">(Mar 12 2019 at 19:40)</a>:</h4>
<p>and to define the coherence goals as relative to a crate</p>



<a name="160602930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602930">(Mar 12 2019 at 19:40)</a>:</h4>
<p>that seems good</p>



<a name="160602970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602970">(Mar 12 2019 at 19:41)</a>:</h4>
<p>so that when we ask "is X local" we can instead ask "same crate or not", I guess</p>



<a name="160602975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602975">(Mar 12 2019 at 19:41)</a>:</h4>
<p>definitely a good question, something to investigate</p>



<a name="160602985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160602985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160602985">(Mar 12 2019 at 19:41)</a>:</h4>
<p>I'm going to rework this paper document to try and extract some of this :)</p>



<a name="160603257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603257">(Mar 12 2019 at 19:44)</a>:</h4>
<p>As I see, chalk's ir is heavily id-based (like, <code>TraitRef</code> is id)</p>



<a name="160603268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603268">(Mar 12 2019 at 19:44)</a>:</h4>
<p>yes</p>



<a name="160603277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603277">(Mar 12 2019 at 19:44)</a>:</h4>
<p>presumably, ids are currently assigned by chanlks parser</p>



<a name="160603284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603284">(Mar 12 2019 at 19:44)</a>:</h4>
<p>actually I don't think so</p>



<a name="160603292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603292">(Mar 12 2019 at 19:44)</a>:</h4>
<p>how this should work with RLS2, where we have our own ids?</p>



<a name="160603300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603300">(Mar 12 2019 at 19:45)</a>:</h4>
<p>I think they are assigned by the intermediate "lowering" step that creates rust-ir</p>



<a name="160603330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603330">(Mar 12 2019 at 19:45)</a>:</h4>
<p>well, I think RLS will be producing the rust-ir level information</p>



<a name="160603335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603335">(Mar 12 2019 at 19:45)</a>:</h4>
<p>directly</p>



<a name="160603343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603343">(Mar 12 2019 at 19:45)</a>:</h4>
<p>so it will just create its own ids</p>



<a name="160603351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603351">(Mar 12 2019 at 19:45)</a>:</h4>
<p>one question would be whether we should be generic over the id type</p>



<a name="160603376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603376">(Mar 12 2019 at 19:45)</a>:</h4>
<p>or whether we should try to extract the id into some shared crate</p>



<a name="160603384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603384">(Mar 12 2019 at 19:45)</a>:</h4>
<p>along with (say) the representation of types</p>



<a name="160603393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603393">(Mar 12 2019 at 19:45)</a>:</h4>
<p>that both RLS + chalk can depend upon</p>



<a name="160603478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603478">(Mar 12 2019 at 19:46)</a>:</h4>
<p>if the IDs are just numbers on both sides, we could also just convert between the types, right</p>



<a name="160603483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603483">(Mar 12 2019 at 19:46)</a>:</h4>
<p>chalk uses a single <code>ItemId</code> for different, right?</p>



<a name="160603495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603495">(Mar 12 2019 at 19:46)</a>:</h4>
<p>RLS2 uses different ids for different types</p>



<a name="160603526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603526">(Mar 12 2019 at 19:47)</a>:</h4>
<p>hm, otoh chalk uses usize for id, and we use u32, so we can use 32 bits for type tag :)</p>



<a name="160603631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603631">(Mar 12 2019 at 19:48)</a>:</h4>
<blockquote>
<p>if the IDs are just numbers on both sides, we could also just convert between the types, right</p>
</blockquote>
<p>yes, that's an option too, just annoying</p>



<a name="160603648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603648">(Mar 12 2019 at 19:48)</a>:</h4>
<p>ok let's leave this as an "open question" for now, but we can certainly interconvert</p>



<a name="160603657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603657">(Mar 12 2019 at 19:48)</a>:</h4>
<blockquote>
<p>RLS2 uses different ids for different types</p>
</blockquote>
<p>we could probably adopt this too</p>



<a name="160603664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603664">(Mar 12 2019 at 19:48)</a>:</h4>
<p>I would expect that there'd be some converting between datastructures anyway, since chalk cares about different things</p>



<a name="160603666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603666">(Mar 12 2019 at 19:48)</a>:</h4>
<p>I don't think chalk has <em>that</em> many ids</p>



<a name="160603689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603689">(Mar 12 2019 at 19:49)</a>:</h4>
<p>yes, I agree there will be some, just not 100% sure which ones</p>



<a name="160603694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603694">(Mar 12 2019 at 19:49)</a>:</h4>
<p>I feel like it may be good to share notions where we can</p>



<a name="160603700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603700">(Mar 12 2019 at 19:49)</a>:</h4>
<p>relatedly -- <code>rust_ir</code> has something called "structs", but in the real world, that would be structs/enums/unions, right?</p>



<a name="160603710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603710">(Mar 12 2019 at 19:49)</a>:</h4>
<p>yeah, interconverting seems easiest to start with: a bit more code to write, a bit less mutual dependency</p>



<a name="160603718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603718">(Mar 12 2019 at 19:49)</a>:</h4>
<blockquote>
<p>relatedly -- <code>rust_ir</code> has something called "structs", but in the real world, that would be structs/enums/unions, right?</p>
</blockquote>
<p>yeah, it's just "nominal types"</p>



<a name="160603739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603739">(Mar 12 2019 at 19:49)</a>:</h4>
<blockquote>
<p>I feel like it may be good to share notions where we can</p>
</blockquote>
<p>so to elaborate a bit, I am specifically think about types, and the reason is that chalk has to do things like unifying types and so forth. And types embed IDs.</p>



<a name="160603743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603743">(Mar 12 2019 at 19:49)</a>:</h4>
<p>if you start with converting, there's the danger that it'll get harder to share later</p>



<a name="160603816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603816">(Mar 12 2019 at 19:50)</a>:</h4>
<blockquote>
<p>I feel like it may be good to share notions where we can</p>
</blockquote>
<p>I actually not 100% sold on this one. If we are in separate repos, sharing "volatile" things could be a pain</p>



<a name="160603817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603817">(Mar 12 2019 at 19:50)</a>:</h4>
<p>I guess we can say this:</p>



<a name="160603835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603835">(Mar 12 2019 at 19:51)</a>:</h4>
<ul>
<li>figure out what the things that chalk uses its ids for</li>
<li>compare against RLS ids</li>
<li>see if we can introduce newtypes</li>
</ul>



<a name="160603853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603853">(Mar 12 2019 at 19:51)</a>:</h4>
<p>i.e., I'd prefer if we are not interconverting enums to flat integers at least</p>



<a name="160603858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603858">(Mar 12 2019 at 19:51)</a>:</h4>
<p>and anyway it might make chalk cleaner</p>



<a name="160603903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160603903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160603903">(Mar 12 2019 at 19:51)</a>:</h4>
<blockquote>
<p>I actually not 100% sold on this one. If we are in separate repos, sharing "volatile" things could be a pain</p>
</blockquote>
<p>I agree. I just don't think that the notion of an id is volatile, but I agree it is not clear cut</p>



<a name="160604032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604032">(Mar 12 2019 at 19:53)</a>:</h4>
<blockquote>
<p>so to elaborate a bit, I am specifically think about types, and the reason is that chalk has to do things like unifying types and so forth. And types embed IDs.</p>
</blockquote>
<p>and yeah, this <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span> I guess some of this comes back to whether we expect to share types etc. I think that, eventually, we really want the type checker and trait solver to be sharing the definition of types. And I think those types must embed IDs. But it's possible that all of this should be "external" to RLS and hence it's ok to interconvert IDs at the boundary. </p>
<p>Seems like we can figure it out a bit as we go.</p>



<a name="160604047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604047">(Mar 12 2019 at 19:53)</a>:</h4>
<p>To start we won't be sharing anyway</p>



<a name="160604108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604108">(Mar 12 2019 at 19:54)</a>:</h4>
<p>How "Ty" type is called in chalk?</p>



<a name="160604133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604133">(Mar 12 2019 at 19:54)</a>:</h4>
<p>I want to glance at what we want to share</p>



<a name="160604150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604150">(Mar 12 2019 at 19:54)</a>:</h4>
<p><a href="https://github.com/rust-lang-nursery/chalk/blob/fc2d9ced016701d86c6bc5d95e124f1bc8020645/chalk-ir/src/lib.rs#L148-L161" target="_blank" title="https://github.com/rust-lang-nursery/chalk/blob/fc2d9ced016701d86c6bc5d95e124f1bc8020645/chalk-ir/src/lib.rs#L148-L161">this is probably the type you mean</a></p>



<a name="160604171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604171">(Mar 12 2019 at 19:55)</a>:</h4>
<p>that is sort of the equivalent of rustc's <code>Ty&lt;'tcx&gt;</code></p>



<a name="160604183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604183">(Mar 12 2019 at 19:55)</a>:</h4>
<p>(I also don't think it's perfect :)</p>



<a name="160604514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604514">(Mar 12 2019 at 19:59)</a>:</h4>
<p>Sharing exactly same type representations seems good to me</p>



<a name="160604544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604544">(Mar 12 2019 at 19:59)</a>:</h4>
<p>I was just reading over the <a href="https://github.com/rust-lang-nursery/chalk/blob/master/src/rust_ir.rs" target="_blank" title="https://github.com/rust-lang-nursery/chalk/blob/master/src/rust_ir.rs">rust-ir definition</a></p>



<a name="160604567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604567">(Mar 12 2019 at 19:59)</a>:</h4>
<p>I guess that, right now, it also uses that same version of <code>Ty</code> to e.g. represent the types in an impl header</p>



<a name="160604580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604580">(Mar 12 2019 at 19:59)</a>:</h4>
<p>(I was trying to remember if we had another variant somewhere)</p>



<a name="160604661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604661">(Mar 12 2019 at 20:00)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> or <span class="user-mention" data-user-id="129457">@Florian Diebold</span> -- where in rust-analyzer is the representation of an impl?</p>



<a name="160604683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604683">(Mar 12 2019 at 20:00)</a>:</h4>
<p>(ps, I'm feeling pretty good about this, it seems like we're starting to have a concrete-ish set of action items)</p>



<a name="160604704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604704">(Mar 12 2019 at 20:00)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir/src/impl_block.rs#L118" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir/src/impl_block.rs#L118">https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir/src/impl_block.rs#L118</a></p>



<a name="160604757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604757">(Mar 12 2019 at 20:01)</a>:</h4>
<p>(that's unresolved, as all the 'HIR' structures in RA)</p>



<a name="160604901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604901">(Mar 12 2019 at 20:03)</a>:</h4>
<p>where is <code>TypeRef</code> to be found?</p>



<a name="160604923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604923">(Mar 12 2019 at 20:03)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir/src/type_ref.rs#L40" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir/src/type_ref.rs#L40">https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir/src/type_ref.rs#L40</a> ;)</p>



<a name="160604934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604934">(Mar 12 2019 at 20:03)</a>:</h4>
<p>yep, I just found it, thanks</p>



<a name="160604943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160604943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160604943">(Mar 12 2019 at 20:03)</a>:</h4>
<p>these file names are totally unpredictable ;)</p>



<a name="160605007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605007">(Mar 12 2019 at 20:04)</a>:</h4>
<p>so that's still very close to the AST</p>



<a name="160605014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605014">(Mar 12 2019 at 20:04)</a>:</h4>
<p>Yes.</p>



<a name="160605023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605023">(Mar 12 2019 at 20:04)</a>:</h4>
<p>I was interpreting this as basically the AST</p>



<a name="160605026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605026">(Mar 12 2019 at 20:04)</a>:</h4>
<p>I mean I know it's not <em>literally</em></p>



<a name="160605032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605032">(Mar 12 2019 at 20:04)</a>:</h4>
<p>but it's "syntactic" in nature</p>



<a name="160605059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605059">(Mar 12 2019 at 20:05)</a>:</h4>
<p>Yeah, this is position-independent AST</p>



<a name="160605062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605062">(Mar 12 2019 at 20:05)</a>:</h4>
<p>it seems fine, we would translate that (combined with name resolution information) into what chalk wants</p>



<a name="160605088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605088">(Mar 12 2019 at 20:05)</a>:</h4>
<p>It's not just ids to make name-resolution lazy</p>



<a name="160605096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605096">(Mar 12 2019 at 20:05)</a>:</h4>
<p>How would we integrate with name resolution?</p>



<a name="160605192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605192">(Mar 12 2019 at 20:06)</a>:</h4>
<p>e.g. for the target type of an impl there's a method that returns the actual (name-resolved) <code>Ty</code>: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir/src/impl_block.rs#L83" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir/src/impl_block.rs#L83">https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir/src/impl_block.rs#L83</a></p>



<a name="160605254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605254">(Mar 12 2019 at 20:07)</a>:</h4>
<p>I'd expect there to be a similar name-resolved <code>TraitRef</code> (maybe it needs a different name) in RA that the target trait would be lowered to</p>



<a name="160605338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605338">(Mar 12 2019 at 20:08)</a>:</h4>
<p>So the Chalk inputs would always be fully resolved?</p>



<a name="160605355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605355">(Mar 12 2019 at 20:08)</a>:</h4>
<p>Good question!</p>



<a name="160605376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605376">(Mar 12 2019 at 20:09)</a>:</h4>
<p>I imagine that we might save some computation if not eagarly resolving</p>



<a name="160605383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605383">(Mar 12 2019 at 20:09)</a>:</h4>
<p>like, imagine <code>impl Foo for (Bar, Baz)</code></p>



<a name="160605415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605415">(Mar 12 2019 at 20:09)</a>:</h4>
<p>I guess there are cases when it's enough to know that target is a tuple, without understanding what <code>Bar</code> and <code>Baz</code> mean exactly</p>



<a name="160605416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605416">(Mar 12 2019 at 20:09)</a>:</h4>
<p>that seems like a lot of complication though</p>



<a name="160605420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605420">(Mar 12 2019 at 20:09)</a>:</h4>
<p>well, it's plausible</p>



<a name="160605421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605421">(Mar 12 2019 at 20:09)</a>:</h4>
<p>can Chalk handle missing information?</p>



<a name="160605422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605422">(Mar 12 2019 at 20:09)</a>:</h4>
<p>sort of</p>



<a name="160605471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605471">(Mar 12 2019 at 20:10)</a>:</h4>
<p>I imagine in the beginning we might not need to worry about this <strong>but</strong></p>



<a name="160605495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605495">(Mar 12 2019 at 20:10)</a>:</h4>
<p>when you ask Chalk to prove some predicate (e.g., is <code>Trait</code> implemented for <code>Ty</code>),</p>



<a name="160605508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605508">(Mar 12 2019 at 20:10)</a>:</h4>
<p>one of the first thing it does is to callback into the context and ask for a <strong>superset</strong> of the rules that might be used to prove that</p>



<a name="160605515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605515">(Mar 12 2019 at 20:10)</a>:</h4>
<p>this is probably the hook we would use to trigger lowering</p>



<a name="160605533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605533">(Mar 12 2019 at 20:11)</a>:</h4>
<p>so it is plausible that we could say (for example) "lower the impls of trait Foo that are for tuples"</p>



<a name="160605537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605537">(Mar 12 2019 at 20:11)</a>:</h4>
<p>(or which might be)</p>



<a name="160605547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605547">(Mar 12 2019 at 20:11)</a>:</h4>
<p>rustc uses a similar sort of trick, categorizing impls into some big bins</p>



<a name="160605559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605559">(Mar 12 2019 at 20:11)</a>:</h4>
<p>basically a hashing trick</p>



<a name="160605624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605624">(Mar 12 2019 at 20:12)</a>:</h4>
<p>so yeah it's plausible that, while Chalk does want name resolution for the impls it requests info about, it may not require access to all the impls</p>



<a name="160605630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605630">(Mar 12 2019 at 20:12)</a>:</h4>
<p>yeah, we have something called <code>TyFingerprint</code> for this</p>



<a name="160605671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605671">(Mar 12 2019 at 20:13)</a>:</h4>
<p>fully resolved types for subset of impls look good</p>



<a name="160605692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605692">(Mar 12 2019 at 20:13)</a>:</h4>
<p>seems to me like that would be done on the level of queries, right? e.g. chalk would ask for 'impls of trait <code>Foo</code> with target type fingerprint <code>Tuple</code>'</p>



<a name="160605704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605704">(Mar 12 2019 at 20:13)</a>:</h4>
<p>this is roughly what I had in mind, yeah</p>



<a name="160605715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605715">(Mar 12 2019 at 20:13)</a>:</h4>
<p>Do we need some kind of type-interning infrastructure?</p>



<a name="160605787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605787">(Mar 12 2019 at 20:14)</a>:</h4>
<p>Or are types just basically PODs with derived Eq and possible duplicates?</p>



<a name="160605808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605808">(Mar 12 2019 at 20:14)</a>:</h4>
<p>well, we don't at first, as I think that neither chalk nor RLS currently uses type interning</p>



<a name="160605829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605829">(Mar 12 2019 at 20:15)</a>:</h4>
<p>I suspect eventually we'll want something but it can wait</p>



<a name="160605847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605847">(Mar 12 2019 at 20:15)</a>:</h4>
<p>maybe based on <a href="https://github.com/salsa-rs/salsa/pull/150" target="_blank" title="https://github.com/salsa-rs/salsa/pull/150">https://github.com/salsa-rs/salsa/pull/150</a> :)</p>



<a name="160605978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160605978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160605978">(Mar 12 2019 at 20:17)</a>:</h4>
<p>so the question above about missing information reminded me, what about dealing with incomplete types? e.g. we might have an <code>Option&lt;{unknown}&gt;</code> because there was a syntax error in there somehow, in the ideal case we'd still know it implements certain traits</p>



<a name="160606003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606003">(Mar 12 2019 at 20:17)</a>:</h4>
<p>hmm that's a good point</p>



<a name="160606013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606013">(Mar 12 2019 at 20:17)</a>:</h4>
<p>Maybe both could work the same way</p>



<a name="160606014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606014">(Mar 12 2019 at 20:17)</a>:</h4>
<p>it seems like we should add some form of "error" variant to chalk's notion of a type</p>



<a name="160606017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606017">(Mar 12 2019 at 20:17)</a>:</h4>
<p>in RA we have <code>Ty::Unknown</code>, but I don't know if that makes sense in chalk</p>



<a name="160606026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606026">(Mar 12 2019 at 20:17)</a>:</h4>
<p>I don't see why not</p>



<a name="160606083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606083">(Mar 12 2019 at 20:18)</a>:</h4>
<p>this probably could be just a fresh inference variant though?</p>



<a name="160606091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606091">(Mar 12 2019 at 20:18)</a>:</h4>
<p>yeah so I'm debating a bit</p>



<a name="160606096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606096">(Mar 12 2019 at 20:18)</a>:</h4>
<p>like, ErrorType is more or less <code>unimplemented!</code></p>



<a name="160606099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606099">(Mar 12 2019 at 20:18)</a>:</h4>
<p>at some level you'll have to represent errors</p>



<a name="160606113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606113">(Mar 12 2019 at 20:18)</a>:</h4>
<p>it might be that you can 'lower' them into uses of inference variables etc <em>but</em></p>



<a name="160606115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606115">(Mar 12 2019 at 20:18)</a>:</h4>
<p>I am wary</p>



<a name="160606140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606140">(Mar 12 2019 at 20:19)</a>:</h4>
<p>because of spurious errors?</p>



<a name="160606142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606142">(Mar 12 2019 at 20:19)</a>:</h4>
<p>I've found that trying to "model" errors as "normal things" leads to complications later and confusing error messages</p>



<a name="160606148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606148">(Mar 12 2019 at 20:19)</a>:</h4>
<p>yeah, it's rare that it's a <em>perfect fit</em></p>



<a name="160606172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606172">(Mar 12 2019 at 20:19)</a>:</h4>
<p>I think e.g. it'd be pretty straight-forward to add an error variant to the "type"</p>



<a name="160606192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606192">(Mar 12 2019 at 20:19)</a>:</h4>
<p>we could represent it as inference variables, but with a special tag so we don't report any diagnostics from it?</p>



<a name="160606262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606262">(Mar 12 2019 at 20:20)</a>:</h4>
<p>I feel like at that point it'd be better to just have an error variant</p>



<a name="160606272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606272">(Mar 12 2019 at 20:20)</a>:</h4>
<p>but a more interesting question, perhaps, is how it propagates to the results</p>



<a name="160606283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606283">(Mar 12 2019 at 20:20)</a>:</h4>
<p>chalk also has a notion of being "unable to prove" things</p>



<a name="160606290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606290">(Mar 12 2019 at 20:20)</a>:</h4>
<p>(i.e., neither true nor false)</p>



<a name="160606301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606301">(Mar 12 2019 at 20:20)</a>:</h4>
<p>I think with the error variant you'd just have to be careful not to treat two errors as the same type, but I have no idea if that's actually a problem in chalk ;)</p>



<a name="160606340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606340">(Mar 12 2019 at 20:21)</a>:</h4>
<p>so it might be that this is a useful thing here -- i.e., if you are asked whether <code>&lt;error&gt; = u32</code>, the answer is <code>¯\_(ツ)_/¯</code> (which was actually our <code>Debug</code> impl for this "can't prove" concept, at least for a time)</p>



<a name="160606418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606418">(Mar 12 2019 at 20:22)</a>:</h4>
<p>this also comes up with overflow, as it happens</p>



<a name="160606426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606426">(Mar 12 2019 at 20:22)</a>:</h4>
<p>e.g., if types get too big, we will introduce approximation</p>



<a name="160606433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606433">(Mar 12 2019 at 20:22)</a>:</h4>
<p>winding up with <code>CannotProve</code> results</p>



<a name="160606470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606470">(Mar 12 2019 at 20:22)</a>:</h4>
<p>anyway it's a good question and we should experiment with it</p>



<a name="160606525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606525">(Mar 12 2019 at 20:23)</a>:</h4>
<p>OK, i'm looking over the notes i've been collecting in <a href="https://paper.dropbox.com/doc/Chalk-RLS-integration--AZOAaGqTORQAptU93qcCqIuOAg-QCJelXDeaq7GV6jVQln4j" target="_blank" title="https://paper.dropbox.com/doc/Chalk-RLS-integration--AZOAaGqTORQAptU93qcCqIuOAg-QCJelXDeaq7GV6jVQln4j">this paper</a></p>



<a name="160606583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606583">(Mar 12 2019 at 20:24)</a>:</h4>
<p>Maybe have an enum with error and "unable to prove" variants, or something</p>



<a name="160606584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606584">(Mar 12 2019 at 20:24)</a>:</h4>
<p>I've added a few lines, hope you don't mind ;)</p>



<a name="160606588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606588">(Mar 12 2019 at 20:24)</a>:</h4>
<p>we've got a number of "refactorings and questions", some pointers into the RLS source, and a few notes on the overall flow</p>



<a name="160606600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160606600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160606600">(Mar 12 2019 at 20:24)</a>:</h4>
<blockquote>
<p>I've added a few lines, hope you don't mind ;)</p>
</blockquote>
<p>oh please add away :)</p>



<a name="160607020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607020">(Mar 12 2019 at 20:25)</a>:</h4>
<p><span class="user-mention" data-user-id="129457">@Florian Diebold</span> one question about those lines though:</p>
<blockquote>
<ul>
<li>Things to add:<ul>
<li><code>TraitRef</code> type for resolved traits</li>
<li>representation of bounds</li>
</ul>
</li>
</ul>
</blockquote>
<p>do we want to add those things into the RLS? Or will we just be creating them when chalk asks for them and hence we should use chalk's data structures?</p>



<a name="160607058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607058">(Mar 12 2019 at 20:25)</a>:</h4>
<p>yeah I wouldn't expect bounds as part of RLS</p>



<a name="160607063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607063">(Mar 12 2019 at 20:25)</a>:</h4>
<p>I think we need to have a 'HIR' for them in RA</p>



<a name="160607123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607123">(Mar 12 2019 at 20:26)</a>:</h4>
<p>because we don't want to go back to the AST when chalk asks for them</p>



<a name="160607145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607145">(Mar 12 2019 at 20:26)</a>:</h4>
<p>Not sure we need a separate HIR, it could be just a method on ImplBlock</p>



<a name="160607180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607180">(Mar 12 2019 at 20:27)</a>:</h4>
<p>yes, and a few enums to represent them</p>



<a name="160607181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607181">(Mar 12 2019 at 20:27)</a>:</h4>
<blockquote>
<p>I think we need to have a 'HIR' for them in RA</p>
</blockquote>
<p>I see, ok.</p>



<a name="160607200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607200">(Mar 12 2019 at 20:27)</a>:</h4>
<p>I'm basically trying to figure out what is a good set of "next steps" here. I feel like this is starting to take shape. It</p>



<a name="160607221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607221">(Mar 12 2019 at 20:27)</a>:</h4>
<p>I've got one thing remaining that's not very clear yet</p>



<a name="160607228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607228">(Mar 12 2019 at 20:27)</a>:</h4>
<p>to me ;)</p>



<a name="160607280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607280">(Mar 12 2019 at 20:28)</a>:</h4>
<p>which is how queries from RLS to chalk will look</p>



<a name="160607378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607378">(Mar 12 2019 at 20:29)</a>:</h4>
<p>I guess the most important one, which we want for completion, is "impl_ty_trait(Ty, TraitRef) -&gt; bool"?</p>



<a name="160607502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607502">(Mar 12 2019 at 20:30)</a>:</h4>
<p>Wouldn't you want a list of traits that a type implements instead?</p>



<a name="160607503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607503">(Mar 12 2019 at 20:30)</a>:</h4>
<p>trait-ref, in my usage, usually includes the self type</p>



<a name="160607505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607505">(Mar 12 2019 at 20:30)</a>:</h4>
<p>jfyi</p>



<a name="160607520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607520">(Mar 12 2019 at 20:31)</a>:</h4>
<p>but yeah I doubt that's the most important one</p>



<a name="160607559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607559">(Mar 12 2019 at 20:31)</a>:</h4>
<p>for one thing, in the general case, the queries can involve variables, and so the answer you get back is not a bool</p>



<a name="160607564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607564">(Mar 12 2019 at 20:31)</a>:</h4>
<p>but includes values for the variables etc</p>



<a name="160607594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607594">(Mar 12 2019 at 20:31)</a>:</h4>
<p>it's more like "Is that trait implemented for these types and -- if so -- what is an exact substitution"</p>



<a name="160607611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607611">(Mar 12 2019 at 20:32)</a>:</h4>
<p>so e.g. you can ask <code>Vec&lt;?T&gt;: Foo</code> and maybe you get back <code>Yes, if ?T = Bar</code></p>



<a name="160607669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607669">(Mar 12 2019 at 20:32)</a>:</h4>
<p>or <code>No</code> (meaning -- not for <strong>any</strong> values of <code>?T</code>)</p>



<a name="160607689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607689">(Mar 12 2019 at 20:32)</a>:</h4>
<p>or Maybe (meaning -- for <em>some</em> values of <code>?T</code>, but we couldn't find an unambig answer)</p>



<a name="160607695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607695">(Mar 12 2019 at 20:32)</a>:</h4>
<p>anyway it's probably a good idea to step back and ask what the RLS would like to ask</p>



<a name="160607698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607698">(Mar 12 2019 at 20:32)</a>:</h4>
<p>irrespective of how chalk works</p>



<a name="160607719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607719">(Mar 12 2019 at 20:33)</a>:</h4>
<p>Can it answer <code>Vec&lt;u32&gt;: Foo&lt;?T&gt;</code></p>



<a name="160607731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607731">(Mar 12 2019 at 20:33)</a>:</h4>
<p>(i am thinking about code compltion)</p>



<a name="160607740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607740">(Mar 12 2019 at 20:33)</a>:</h4>
<p>certainly in rustc's <strong>method resolution</strong> code, we do ask questions kind of like the one <span class="user-mention" data-user-id="133169">@matklad</span> posed, where the bool represents kind of "could this be true, for <strong>some</strong> types"? so maybe that is a useful one for the RLS</p>



<a name="160607762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607762">(Mar 12 2019 at 20:33)</a>:</h4>
<blockquote>
<p>Wouldn't you want a list of traits that a type implements instead?</p>
</blockquote>
<p>my thinking on that is currently that we'd go through all the traits that are in scope and ask whether they're implemented by the type, separately</p>



<a name="160607766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607766">(Mar 12 2019 at 20:33)</a>:</h4>
<p>we will know the type precisely, so there shouldn't be <code>?</code> on the left hand side</p>



<a name="160607770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607770">(Mar 12 2019 at 20:33)</a>:</h4>
<blockquote>
<p>Can it answer <code>Vec&lt;u32&gt;: Foo&lt;?T&gt;</code></p>
</blockquote>
<p>I'm not sure I follow :)</p>



<a name="160607818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607818">(Mar 12 2019 at 20:34)</a>:</h4>
<blockquote>
<p>we will know the type precisely, so there shouldn't be <code>?</code> on the left hand side</p>
</blockquote>
<p>why would you know the type precisely?</p>



<a name="160607828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607828">(Mar 12 2019 at 20:34)</a>:</h4>
<p>I mean a lot of times you won't</p>



<a name="160607833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607833">(Mar 12 2019 at 20:34)</a>:</h4>
<p>yeah</p>



<a name="160607838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607838">(Mar 12 2019 at 20:34)</a>:</h4>
<p>because there will be inference variables whose result is not known</p>



<a name="160607850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607850">(Mar 12 2019 at 20:34)</a>:</h4>
<p>code completion runs on fully type-checked code</p>



<a name="160607854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607854">(Mar 12 2019 at 20:34)</a>:</h4>
<p>e.g., <code>let mut x = None; x.foo(</code> then <code>x</code> has type <code>Option&lt;?T&gt;</code></p>



<a name="160607881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607881">(Mar 12 2019 at 20:35)</a>:</h4>
<p>we need the <code>implements</code> query to get that fully type-checked code though ;)</p>



<a name="160607904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607904">(Mar 12 2019 at 20:35)</a>:</h4>
<p>yeah</p>



<a name="160607917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607917">(Mar 12 2019 at 20:35)</a>:</h4>
<p>so, what I am trying to say that there are two modes for questions</p>



<a name="160607933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607933">(Mar 12 2019 at 20:35)</a>:</h4>
<p>questions during type inference (presumably the same as in rustc)</p>



<a name="160607949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607949">(Mar 12 2019 at 20:35)</a>:</h4>
<p>questions during completion (might be different)</p>



<a name="160607958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160607958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160607958">(Mar 12 2019 at 20:35)</a>:</h4>
<p>anyway so yeah maybe we take the "method resolution" to be the main goal, makes sense, and I think in that case the main interface rustc uses is the "evaluate" one, which basically asks whether an impl <em>might</em> exist. I suppose we also have to implement searches around the <code>Deref</code> trait (which is a similar query, ultimately)</p>



<a name="160608044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608044">(Mar 12 2019 at 20:36)</a>:</h4>
<p>So Chalk has a choice when it finds inconclusive results: it can ask for more type info, or it can just return what it has</p>



<a name="160608056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608056">(Mar 12 2019 at 20:36)</a>:</h4>
<p>(as an aside, moving the method resolution algorithm into shared code is another (long-term) goal of mine)</p>



<a name="160608084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608084">(Mar 12 2019 at 20:37)</a>:</h4>
<blockquote>
<p>So Chalk has a choice when it finds inconclusive results: it can ask for more type info, or it can just return what it has</p>
</blockquote>
<p>presently, no. It always gives back a result. If you want to add more type info, you can formulate another query.</p>



<a name="160608117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608117">(Mar 12 2019 at 20:37)</a>:</h4>
<p>so it's more that you, as the one posing the queries, have a choice :)</p>



<a name="160608154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608154">(Mar 12 2019 at 20:37)</a>:</h4>
<p>Ah right, that's effectively the same</p>



<a name="160608237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608237">(Mar 12 2019 at 20:38)</a>:</h4>
<p>(actually, at the lowest level interface, which probably isn't the one RLS wants but it <em>may</em> be, chalk yields back an iterator of answers, and you can choose whether to keep asking for more)</p>



<a name="160608252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608252">(Mar 12 2019 at 20:38)</a>:</h4>
<p>we then have a wrapper that tries to decide how long it makes sense to keep pulling</p>



<a name="160608260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608260">(Mar 12 2019 at 20:39)</a>:</h4>
<blockquote>
<p>(as an aside, moving the method resolution algorithm into shared code is another (long-term) goal of mine)</p>
</blockquote>
<p>BTW, do we expect to keep type inference inside RLS2, or is it a good occasion to start moving it out?</p>



<a name="160608342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608342">(Mar 12 2019 at 20:40)</a>:</h4>
<p>My expectation is that the type checker that is "invoking" chalk will always have its own "type inference context", basically. Whether that type checker lives in RLS2 or some shared library is another question.</p>



<a name="160608415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608415">(Mar 12 2019 at 20:40)</a>:</h4>
<p>So I guess the question is -- how do we get more precise about the queries we need</p>



<a name="160608424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608424">(Mar 12 2019 at 20:40)</a>:</h4>
<p>maybe we should make our first goal</p>



<a name="160608431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608431">(Mar 12 2019 at 20:40)</a>:</h4>
<p>be integrating with the existing type checker</p>



<a name="160608438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608438">(Mar 12 2019 at 20:40)</a>:</h4>
<p>vs completions -- not sure how different that is</p>



<a name="160608445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608445">(Mar 12 2019 at 20:40)</a>:</h4>
<p>my main point is that the existing type checker, well, <em>exists</em></p>



<a name="160608467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608467">(Mar 12 2019 at 20:41)</a>:</h4>
<p>so we can see the goal as primarily being one of helping it assign types better</p>



<a name="160608472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608472">(Mar 12 2019 at 20:41)</a>:</h4>
<p>for the time being</p>



<a name="160608481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608481">(Mar 12 2019 at 20:41)</a>:</h4>
<p>yeah. I'd game to integrate <em>something</em>, and than see what we need as we go</p>



<a name="160608507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608507">(Mar 12 2019 at 20:41)</a>:</h4>
<p>so that means that a good starting point is to kind of enumerate where in the type-checker trait resolution would fit in. The obvious place is method resolution, but there are other spots-- e.g., proving where clauses</p>



<a name="160608559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608559">(Mar 12 2019 at 20:42)</a>:</h4>
<p>I guess that the current type-checker doesn't probably make much effort at doing that since that is <em>mostly</em> useful for finding errors (but not entirely, it can inform inference too)</p>



<a name="160608568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608568">(Mar 12 2019 at 20:42)</a>:</h4>
<p>e.g., <code>fn foo&lt;A, B&gt;(x: A) -&gt; B where A: Deref&lt;Target = B&gt;</code></p>



<a name="160608572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608572">(Mar 12 2019 at 20:42)</a>:</h4>
<p>yeah, proving where-clauses is actually pretty interesting e.g. for chains of iterator methods</p>



<a name="160608581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608581">(Mar 12 2019 at 20:42)</a>:</h4>
<p>yep, another great example</p>



<a name="160608590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608590">(Mar 12 2019 at 20:43)</a>:</h4>
<p>that might be a mildly easier starting point</p>



<a name="160608596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608596">(Mar 12 2019 at 20:43)</a>:</h4>
<p>where-clauses I mean</p>



<a name="160608603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608603">(Mar 12 2019 at 20:43)</a>:</h4>
<p>though really once we have anything working I think integrating more won't be super hard</p>



<a name="160608612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608612">(Mar 12 2019 at 20:43)</a>:</h4>
<p>so the way I had envisioned this working in rustc, and I think it would work the same in RLS</p>



<a name="160608683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608683">(Mar 12 2019 at 20:44)</a>:</h4>
<p>As an "end goal", completion &amp; goto def working for iterator chains would be pretty great</p>



<a name="160608688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608688">(Mar 12 2019 at 20:44)</a>:</h4>
<p>method resolution feels to me like the more useful starting point though (for iterator chains, we need both anyway)</p>



<a name="160608698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608698">(Mar 12 2019 at 20:44)</a>:</h4>
<p>is that we'd have a few queries, sort of like</p>
<ul>
<li><code>fn chalk_engine(&amp;self) -&gt; ChalkEngine</code> -- this is a <strong>volatile</strong> query, so it gets recreated every revision<ul>
<li>it will store the incremental chalk state, which is distinct from salsa's incremental state</li>
</ul>
</li>
<li><code>fn prove(&amp;self, g: CanonicalGoal) -&gt; CanonicalResult</code></li>
</ul>



<a name="160608721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608721">(Mar 12 2019 at 20:45)</a>:</h4>
<p>a <a href="https://rust-lang.github.io/rustc-guide/traits/canonical-queries.html" target="_blank" title="https://rust-lang.github.io/rustc-guide/traits/canonical-queries.html">"canonical" goal</a> is one where the unresolved inference variables have been rewritten</p>



<a name="160608771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608771">(Mar 12 2019 at 20:46)</a>:</h4>
<p>this <a href="https://rust-lang.github.io/rustc-guide/traits/canonical-queries.html" target="_blank" title="https://rust-lang.github.io/rustc-guide/traits/canonical-queries.html">rustc-guide chapter</a> gives more details on that</p>



<a name="160608822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608822">(Mar 12 2019 at 20:46)</a>:</h4>
<p>yeah, the canonicalization is actually another thing I was wondering about -- will RLS need to do that, or can chalk help? I'm not sure if it's even actually complicated to implement</p>



<a name="160608836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608836">(Mar 12 2019 at 20:46)</a>:</h4>
<p>anyway, the idea is that <code>prove</code> will -- internally -- access the chalk-engine and pull out enough answers to come up with a conclusion.</p>



<a name="160608859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608859">(Mar 12 2019 at 20:46)</a>:</h4>
<blockquote>
<p>yeah, the canonicalization is actually another thing I was wondering about -- will RLS need to do that, or can chalk help? I'm not sure if it's even actually complicated to implement</p>
</blockquote>
<p>this is why I keep talking about sharing the repr of types</p>



<a name="160608873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608873">(Mar 12 2019 at 20:46)</a>:</h4>
<p>if we are doing that, then we should be able to share the code chalk uses to do it</p>



<a name="160608879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608879">(Mar 12 2019 at 20:46)</a>:</h4>
<p>not that it's super hard</p>



<a name="160608885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608885">(Mar 12 2019 at 20:46)</a>:</h4>
<p>but it'd be good to share</p>



<a name="160608928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160608928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160608928">(Mar 12 2019 at 20:47)</a>:</h4>
<blockquote>
<p>anyway, the idea is that <code>prove</code> will -- internally -- access the chalk-engine and pull out enough answers to come up with a conclusion.</p>
</blockquote>
<p>anyway, the type checker's main job then is basically to keep a list of 'unproven things'. It keeps trying to prove. If the attempt <strong>succeeds</strong>, the item can be removed from the list. We also get back some "substitutions" we can apply as a result that can help inference along (even an ambiguous result might be able to tell us <em>some</em> things)</p>



<a name="160609009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609009">(Mar 12 2019 at 20:48)</a>:</h4>
<p>I <em>think</em> this is roughly what we did in rustc ;) <span class="user-mention" data-user-id="131694">@scalexm</span> would remember better</p>



<a name="160609045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609045">(Mar 12 2019 at 20:48)</a>:</h4>
<p>And those substitutions would work on the shared AST?</p>



<a name="160609060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609060">(Mar 12 2019 at 20:48)</a>:</h4>
<p>I could imagine trying to "mock this up" in RLS 2.0 to start</p>



<a name="160609086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609086">(Mar 12 2019 at 20:49)</a>:</h4>
<p>perhaps with some hand-coded rules, like .. idk .. <code>Vec&lt;T&gt;: Clone</code> if <code>T: Clone</code></p>



<a name="160609095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609095">(Mar 12 2019 at 20:49)</a>:</h4>
<p>not sure if that's worth the trouble :)</p>



<a name="160609135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609135">(Mar 12 2019 at 20:50)</a>:</h4>
<blockquote>
<p>And those substitutions would work on the shared AST?</p>
</blockquote>
<p>they would apply to the types from the goal -- i.e., if we asked <code>vec::IntoIter&lt;Vec&lt;u32&gt;&gt;: Iterator&lt;Item=?X&gt;</code>, the result might include the substitution <code>?X = u32</code></p>



<a name="160609223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609223">(Mar 12 2019 at 20:50)</a>:</h4>
<p>Do we want to discuss technical details about sharing? Like what code lives where, what do we use instead git-submodules, etc? :)</p>



<a name="160609322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609322">(Mar 12 2019 at 20:51)</a>:</h4>
<p>Hmm. I was expecting to publish stuff through <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a>, I guess</p>



<a name="160609333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609333">(Mar 12 2019 at 20:51)</a>:</h4>
<p>but maybe we don't want to do that to start</p>



<a name="160609381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609381">(Mar 12 2019 at 20:52)</a>:</h4>
<p>A plausible first step would be:</p>
<ul>
<li>extract a <code>rust_ty</code> crate in the chalk repo with <code>ty</code> repr</li>
<li>switch RLS to use that via git dependency</li>
</ul>



<a name="160609426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609426">(Mar 12 2019 at 20:52)</a>:</h4>
<p>I'd start with RLS2 using git-deps to depend on (stable) crates of chalk repo</p>



<a name="160609460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609460">(Mar 12 2019 at 20:52)</a>:</h4>
<p><a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a> seems to be an overhead</p>



<a name="160609490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609490">(Mar 12 2019 at 20:53)</a>:</h4>
<p>seems fine</p>



<a name="160609503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609503">(Mar 12 2019 at 20:53)</a>:</h4>
<p>I'm debating about the idea of starting out by sharing types. I .. kind of like it maybe.</p>



<a name="160609506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609506">(Mar 12 2019 at 20:53)</a>:</h4>
<p>I don't know about switching RA to using chalk's type representation immediately</p>



<a name="160609566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609566">(Mar 12 2019 at 20:53)</a>:</h4>
<p>It's certainly a goal to work towards</p>



<a name="160609665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609665">(Mar 12 2019 at 20:54)</a>:</h4>
<blockquote>
<p>I don't know about switching RA to using chalk's type representation immediately</p>
</blockquote>
<p>Because that representation could change based on how the RLS is going to use it?</p>



<a name="160609697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609697">(Mar 12 2019 at 20:55)</a>:</h4>
<p>Or because RA's representation is too different?</p>



<a name="160609779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609779">(Mar 12 2019 at 20:56)</a>:</h4>
<p>because it will be a huge change if we try to do it all at once, yes</p>



<a name="160609791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609791">(Mar 12 2019 at 20:56)</a>:</h4>
<p>(I actually tried it a bit)</p>



<a name="160609798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609798">(Mar 12 2019 at 20:56)</a>:</h4>
<p>yeah, it's probably a good idea to try and dig into that task separately</p>



<a name="160609810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609810">(Mar 12 2019 at 20:56)</a>:</h4>
<p>I'm going to have to go soon</p>



<a name="160609817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609817">(Mar 12 2019 at 20:56)</a>:</h4>
<p>but try to break it into some steps</p>



<a name="160609833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609833">(Mar 12 2019 at 20:57)</a>:</h4>
<p>On the chalk side, I think a good first step is work on refactoring the lowering code</p>



<a name="160609852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609852">(Mar 12 2019 at 20:57)</a>:</h4>
<p>with an eye towards integration into RLS</p>



<a name="160609894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609894">(Mar 12 2019 at 20:57)</a>:</h4>
<p>if someone were interested, i'd be interested in trying to collaborate with someone</p>



<a name="160609908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609908">(Mar 12 2019 at 20:57)</a>:</h4>
<p><span class="user-mention" data-user-id="129457">@Florian Diebold</span> what would be the better first-step? Explicit mapping beween all RA types and all chalks types?</p>



<a name="160609912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609912">(Mar 12 2019 at 20:58)</a>:</h4>
<p>i.e., I'd like to schedule some pair prog time to start playing with that, then I can go get real busy and not have any time, and that person (or people) can carry on ;)</p>



<a name="160609969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609969">(Mar 12 2019 at 20:58)</a>:</h4>
<p>I think we need to at least solve the <code>ItemId</code> question before we can share the representation, and to do that it would probably be helpful to first implement it as a conversion, yes</p>



<a name="160609990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160609990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160609990">(Mar 12 2019 at 20:58)</a>:</h4>
<p>my guess would be that the way to do the transition would be</p>



<a name="160610001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610001">(Mar 12 2019 at 20:58)</a>:</h4>
<p>to first try and refactor the <strong>RLS definition</strong> to be closer to the chalk definition</p>



<a name="160610004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610004">(Mar 12 2019 at 20:59)</a>:</h4>
<p>bit by bit</p>



<a name="160610016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610016">(Mar 12 2019 at 20:59)</a>:</h4>
<p>we may encounter challenges along the way</p>



<a name="160610028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610028">(Mar 12 2019 at 20:59)</a>:</h4>
<p>eventually, if we can get it to be the same, <em>then</em> we can take the dependency</p>



<a name="160610034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610034">(Mar 12 2019 at 20:59)</a>:</h4>
<p>yeah, that seems good to me</p>



<a name="160610056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610056">(Mar 12 2019 at 20:59)</a>:</h4>
<p>one very simple first step there</p>



<a name="160610133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610133">(Mar 12 2019 at 21:00)</a>:</h4>
<p>the <a href="https://github.com/rust-analyzer/rust-analyzer/blob/97a87bf3a68338b1acc2b7a02dfa43096bf47e05/crates/ra_hir/src/ty.rs#L23-L27" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/97a87bf3a68338b1acc2b7a02dfa43096bf47e05/crates/ra_hir/src/ty.rs#L23-L27">rust-analyzer Ty</a> has a ton of variants for things like bool etc (like rustc itself)</p>



<a name="160610147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610147">(Mar 12 2019 at 21:00)</a>:</h4>
<p>but chalk basically lumps <strong>all</strong> of those together into "applied" to an id</p>



<a name="160610155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610155">(Mar 12 2019 at 21:00)</a>:</h4>
<p>(so e.g. there is an id for <code>bool</code>, which in chalk terms if a "struct" :P)</p>



<a name="160610165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610165">(Mar 12 2019 at 21:00)</a>:</h4>
<p>(that terminology should obviously change)</p>



<a name="160610177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610177">(Mar 12 2019 at 21:01)</a>:</h4>
<blockquote>
<p>and that person (or people) can carry on ;)</p>
</blockquote>
<p>I personally am stuck with macros for some time, but I definitely will be watching for this :)</p>



<a name="160610184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610184">(Mar 12 2019 at 21:01)</a>:</h4>
<p>anyway, but yeah trying to consolidate those variants and make things more uniform</p>



<a name="160610206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610206">(Mar 12 2019 at 21:01)</a>:</h4>
<p>so, on a meta point</p>



<a name="160610208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610208">(Mar 12 2019 at 21:01)</a>:</h4>
<p>one thing we've been thinking about in the Traits Working Group</p>



<a name="160610222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610222">(Mar 12 2019 at 21:01)</a>:</h4>
<p>is that we are going to wind up with kind of "subworking groups" that are operating somewhat independently</p>



<a name="160610225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610225">(Mar 12 2019 at 21:01)</a>:</h4>
<p>this feels like an obvious one</p>



<a name="160610230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610230">(Mar 12 2019 at 21:01)</a>:</h4>
<p>I'm not saying we actually go "form a working group"</p>



<a name="160610273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610273">(Mar 12 2019 at 21:02)</a>:</h4>
<p>but just thinking that we might want a kind of regular meeting time</p>



<a name="160610287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610287">(Mar 12 2019 at 21:02)</a>:</h4>
<p>we're getting towards work items here</p>



<a name="160610492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610492">(Mar 12 2019 at 21:05)</a>:</h4>
<p>I'm compiling some <a href="https://paper.dropbox.com/doc/Chalk-RLS-integration--AZOAaGqTORQAptU93qcCqIuOAg-QCJelXDeaq7GV6jVQln4j#:uid=966729034471911231328712&amp;h2=immediate-work-items-and-steps" target="_blank" title="https://paper.dropbox.com/doc/Chalk-RLS-integration--AZOAaGqTORQAptU93qcCqIuOAg-QCJelXDeaq7GV6jVQln4j#:uid=966729034471911231328712&amp;h2=immediate-work-items-and-steps">immediate work items and steps</a> from the rest of the doc</p>



<a name="160610623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610623">(Mar 12 2019 at 21:06)</a>:</h4>
<p>but maybe that's not useful</p>



<a name="160610636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610636">(Mar 12 2019 at 21:06)</a>:</h4>
<p>maybe a better way is to put the [ ] work items into the top two sections :)</p>



<a name="160610755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610755">(Mar 12 2019 at 21:08)</a>:</h4>
<p>(Sorry, I’ve been semi-following the conv since it’s dinner time here) I’d probably be game to do some refactoring on chalk</p>



<a name="160610807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610807">(Mar 12 2019 at 21:08)</a>:</h4>
<p>It would probably be easier than writing code in rustc since I have little time currently, at least I don’t have to deal with rebasing and bors etc</p>



<a name="160610864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610864">(Mar 12 2019 at 21:09)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> would you be available around (say) 14:00 UTC-04:00 tomorrow? (probably 19:00 your time?)</p>



<a name="160610888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610888">(Mar 12 2019 at 21:09)</a>:</h4>
<p>19:00 might be hard, 20:00 is better</p>



<a name="160610964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610964">(Mar 12 2019 at 21:10)</a>:</h4>
<p>ok, how about this -- I'll do some experimentation starting earlier, and we'll sync up at 20:00?</p>



<a name="160610974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160610974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160610974">(Mar 12 2019 at 21:10)</a>:</h4>
<p>Sounds good!</p>



<a name="160611056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160611056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160611056">(Mar 12 2019 at 21:11)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span> by everyone!</p>
<p>Thanks for organizing convo <span class="user-mention" data-user-id="116009">@nikomatsakis</span> , its very helpful!</p>



<a name="160611115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160611115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160611115">(Mar 12 2019 at 21:12)</a>:</h4>
<p>Yes, this was great. <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> Thanks all.</p>



<a name="160611282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160611282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160611282">(Mar 12 2019 at 21:14)</a>:</h4>
<blockquote>
<p>is that we are going to wind up with kind of "subworking groups" that are operating somewhat independently</p>
</blockquote>
<p>to continue along this vein -- maybe we should make a Zulip steam like <code>t-compiler/wg-rls-2.0/chalk</code>?</p>



<a name="160611316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160611316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160611316">(Mar 12 2019 at 21:15)</a>:</h4>
<p>I wanted to call it "rls 2.0 <span aria-label="heart" class="emoji emoji-2764" role="img" title="heart">:heart:</span> chalk", but I'm not sure if stream names can have emojis</p>



<a name="160611333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160611333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160611333">(Mar 12 2019 at 21:15)</a>:</h4>
<p>I guess I could test it :)</p>



<a name="160612304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160612304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160612304">(Mar 12 2019 at 21:26)</a>:</h4>
<p>I'd like to contribute, but I'm not sure what to work on since I'm not too familiar with RA/Chalk yet. Maybe the Ids?</p>



<a name="160612390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160612390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160612390">(Mar 12 2019 at 21:27)</a>:</h4>
<p>The "refactor to match" would probably change Chalk's single Id type to separate Ids like RA, right?</p>



<a name="160612500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160612500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160612500">(Mar 12 2019 at 21:29)</a>:</h4>
<p><span class="user-mention" data-user-id="125131">@detrumi</span> actually I wanted to ping you</p>



<a name="160612520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160612520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160612520">(Mar 12 2019 at 21:29)</a>:</h4>
<p>I think the ids would be a great choice, yes</p>



<a name="160612671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160612671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160612671">(Mar 12 2019 at 21:30)</a>:</h4>
<blockquote>
<p>I guess I could test it :)</p>
</blockquote>
<p>tested..emojis don't work</p>



<a name="160612906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160612906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160612906">(Mar 12 2019 at 21:33)</a>:</h4>
<p>Please don't add that to the Zulip feature wishlist, I fear they won't take us seriously any more <span aria-label="big smile" class="emoji emoji-1f604" role="img" title="big smile">:big_smile:</span></p>



<a name="160617251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/chalk%20integration/near/160617251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/chalk.20integration.html#160617251">(Mar 12 2019 at 22:36)</a>:</h4>
<blockquote>
<p>to continue along this vein -- maybe we should make a Zulip steam like <code>t-compiler/wg-rls-2.0/chalk</code>?</p>
</blockquote>
<p>I'm going to make it -- if for no other reason than that it will make it easier for me to respond to people who are talking about the chalk integration plan :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>